function wbp2u(){
  // D:\Development\python-project\spider\dongfang\get_requests\src\test\js\wbp2u.js
    const cookie = require("cookie");
    const cooks = require("./cooks.js");

    // 模拟浏览器的 document.cookie
    const cookieString = "qgqp_b_id=e5c1215b302e908f9e9596bc1598ab11; websitepoptg_api_time=1733498615406; rskey=LAoksaTBnVnVzZ204UnJoVXlkS3ZTL0t5dz09zNzUM; isoutside=0; st_si=90576546761010; st_asi=delete; st_pvi=13044721870445; st_sp=2024-12-03%2020%3A18%3A01; st_inirUrl=https%3A%2F%2Fwww.baidu.com%2Flink; st_sn=4; st_psi=20241207145759174-113200301321-4389428662";
    const parsedCookies = cookie.parse(cookieString);

    // 重写 cooks.js 的 get 方法以使用 parsedCookies
    const browserCooks = {
      get(name) {
        return parsedCookies[name] || null;
      },
      set(key, value, expiredays, domain) {
        // 这里只是模拟设置 cookie，实际不会影响全局 cookie
        parsedCookies[key] = value;
      },
      del(key, domain) {
        delete parsedCookies[key];
      }
    };

    var delayparams = 'UID|0|MOBILE|0|web';

    if (browserCooks.get('uidal')) {
      delayparams = delayparams.replace('UID', browserCooks.get('uidal').substring(0, 16));
    } else {
      delayparams = delayparams.replace('UID', '');
    }

    if (browserCooks.get('mtp') != null) {
      if (browserCooks.get('mtp') == '0') {
        delayparams = delayparams.replace('MOBILE', '3');
      } else {
        delayparams = delayparams.replace('MOBILE', browserCooks.get('mtp'));
      }
    } else {
      delayparams = delayparams.replace('MOBILE', '0');
    }

    return delayparams
}
console.log(wbp2u())